import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    key: ''
  },
  mutations: {
    setData(state, param) { //param:{key:*,val:*}
      var val = param.val;
      if (typeof param.val == "object") {
        val = JSON.stringify(val);
      }
      eval(`state.${param.key}=${val}`);
    }
  },
  actions: {},
  modules: {}
});